#include "ViewCamera.h"
#include "Model.h"
#include <iostream>
#include <osgViewer/Viewer>
#include <queue>

void ViewCamera::setDataChanged(){
	queue<Vec3>* queue = Model::getInstance()->getOperationsMove(getId());
	if(queue->size() <= 0)return;
	Vec3 current = queue->front();
	queue->pop();
	cout << "Move camera to" << endl;
	cout << "(" << current.x() << "," << current.y() << "," << current.z() << ")" << endl;
	Vec3 eye = Vec3(current.x(),current.y(),current.z());
	Vec3 up = Vec3(0,1,0);
	cam->setViewMatrixAsLookAt(eye,center,up);
}